Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Filter out che commands imported by plugins/contributions #194

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

azatsarynnyy
Copy link
Member

@azatsarynnyy azatsarynnyy commented Mar 28, 2023

What does this PR do?

Filters out che commands imported by plugins/contributions as they are not expected to be run by the user.

What issues does this PR fix?

eclipse-che/che#22098
implements the suggestion #192 (review)

How to test this PR?

  1. Start a new workspace from the test project https://github.com/azatsarynnyy/java-spring-petclinic/tree/filter-cmds. The project is configured to use the editor image built from this PR.
  2. Verify that there is no init-che-code-command command among the devfile-type Tasks.

@github-actions
Copy link

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

Click here to review and test in web IDE: Contribute

.filter(command => !command.attributes || (command.attributes as any)['controller.devfile.io/imported-by'] !== 'editor')
.filter(command => !command.attributes || (command.attributes as any)['controller.devfile.io/imported-by'] === undefined)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another case that just occurred to me that we may want to cover -- there's a special case when devfiles use parents. In this case, the command would have the attribute controller.devfile.io/imported-by: "parent" (hard-coded, by DWO). Should we include those commands?

E.g. see the example in this issue: eclipse-che/che#22103 -- we likely want to include the commands from the java-maven parent.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thanks @amisevsk !
I've prepared a fix in the draft PR https://github.com/che-incubator/che-code/pull/197/files. Will test it once the dogfoding instance is fixed (eclipse-che/che#22108) and merge.

@azatsarynnyy azatsarynnyy merged commit d430776 into main Mar 28, 2023
@azatsarynnyy azatsarynnyy deleted the che-task-filter branch March 28, 2023 20:10
@devstudio-release
Copy link

Build 3.6 :: code_3.x/496: Console, Changes, Git Data

@devstudio-release
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants